import requests from "./request";


//发送验证码
export const loginyzm = (phone) =>
    requests.get('/captcha/sent',{params:{phone:phone}})
    //检验验证码是否正确
export const loginyzyzm = (phone,yzma) =>
    requests.get(`/captcha/verify?phone=${phone}&captcha=${yzma}`).catch((error)=>{
        return error.response.data
       
    })
    //检验手机号是否被注册
export const loginsjyz = (phone) =>
    requests.get('/cellphone/existence/check',{params:{phone:phone}})
    //注册请求
export const loginresgit = (phone,password,captcha,nickname) =>
 requests.get('/register/cellphone',{params:{phone:phone,password:password,captcha:captcha,nickname:nickname}}).catch((error)=>{
    return error.response.data
   
})   
//登录接口
 export const login =(phone,password)=>
 requests.get('/login/cellphone',{params:{phone:phone,password:password}}).catch((error)=>{
    return error.response.data
})   
 //获取登录状态
 export const  loginstatus = ()=>
  requests.get('/login/status')
  //刷新登录状态
  export const  loginrefresh = ()=>
  requests.get('/login/refresh')
//获取获取账号信息
export const  loginaccount = ()=>
requests.get('/user/account')
//搜索建议
export const searchsg = (keyword)=>
requests.get(`/search/suggest?keywords=${keyword}`)
//图片轮播
export const recomrbo =()=>
    requests.get('/personalized/newsong',{params:{limit:6}})
//音乐获取
export const getmusic =(id)=>
  requests.get(`/song/url?id=${id}`)
  //推荐歌单
  export const getgedan =()=>
   requests.get(`/personalized?limit=${10}`)
   //获取歌单分类列表
   export const getgdlist =()=>
   requests.get('/playlist/catlist')
   //获取热门歌单分类
   export const gethotlist = ()=>
   requests.get('/playlist/hot')
   //获取歌单根据分类的歌单列表
   export const getcatelist =(m,mi)=>
   requests.get('/top/playlist' ,{params:{cat:m,limit:10,offset:mi||0}})
   //获取歌单排行
   export const getrank =()=>
   requests.get('/toplist')
   //获取歌单排行详情
   export const getranklist =(m)=>
   requests.get('/playlist/track/all',{params:{limit:8,id:m}})
   //歌手分类
   export const getsongs =(m,mi,ms,mq)=>{
       return requests.get('/artist/list',{params:{limit:18,offset:m||0,initial:mi||'',type:ms||'',area:mq||'' }})
   }
   //最新mv
   export const getnewmv =(m)=>{
       return requests.get(`/mv/first?limit=${8}&area=${m}` )
   }
 //获取mv数据
  export const getmvlist =(m)=>{
      return requests.get('/mv/detail',{params:{mvid:m}})
  }
  //mv 地址
  export const getmedio =(m)=>{
      return requests.get('/mv/url',{params:{id:m}})
  }
  //推荐mv
  export const getrecmv =()=>{
      return requests.get(`/personalized/mv`)
  }
  //mv排行榜
  export const getrankmv =(m)=>{
      return requests.get(`/top/mv?limit=${10}&area=${m}`)
  }
  //最新歌曲
  export const getnewmusic =()=>{
      return requests.get('/album/newest')
  }
  //全球新歌
  export const getallmusic =(m,mi)=>{
      return requests.get('/album/new',{params:{limit:10,area:m||'ALL',offset:mi||0}})
  }
  //歌单详情
  export const getgedanmusic =(m)=>{
      return requests.get('/playlist/detail' ,{params:{id:m}})
  }
  //歌单评论
  export const getgdcomment=(m)=>{
      return requests.get('/comment/playlist',{params:{id:m}})
  }
  //评论接口
  export const setcomment =(t,id,type,content )=>{
    return requests.get('/comment',{params:{t:t,id:id,type:type,content:content}})
  }
  //歌曲详情
  export const getmusiclist = (ids)=>{
       return requests.get('/song/detail',{params:{ids:ids}})
  }
  //歌手专辑
  export const getzhuanji =(m,mi)=>{
     
      return requests.get('/artist/album',{params:{id:m,limit:14,offset:mi}})
  }
  //歌手详情
  export const getsongslist =(id)=>{
      return requests.get('/artist/detail',{params:{id:id}})
  }
  //歌手mv详情
  export const getsongsmv =(m,mi)=>
requests.get('/artist/mv',{params:{id:m,offset:mi,limit:12}})
//歌手描述
export const getsongsdsc =(id)=>{
    return requests.get('/artist/desc',{params:{id:id}})
}
//相似歌手
export const getlikesongs =(id)=>{
    return requests.get('/simi/artist',{params:{id:id}})
}